#ifndef VSWORLD_H
#define VSWORLD_H
#include "VSObject.h"
#include "VSVector3.h"
#include "VSQuat.h"

#include "VSActor.h"
#include "VSSceneMap.h"
#include "VSCameraActor.h"
namespace VSEngine2
{
	class VSStream;
	class VSGRAPHIC_API VSWorld : public VSObject
	{
		//PRIORITY
		
		//RTTI
		DECLARE_RTTI;
	public:
		VSWorld();
		virtual ~VSWorld();

		DECLARE_INITIAL
		static VSWorld * ms_pWorld;

	protected:
		VSArray<VSSceneMapPtr>	m_SceneArray;
		VSArray<VSActor *>	m_ActorArray;
		VSArray<VSMessage> m_MessageArray;
		VSCameraActorPtr   m_pMainCameraActor;
	public:
		
		void AddActor(VSActor * pActor);
		void DeleteActor(VSActor * pActor);
		VSSceneMap* CreateScene(const TCHAR * pName);

		VSSceneMap * GetScene(const VSUsedName & Name);

		VSActor * CreateActor(const TCHAR *  ActorPath, VSSceneMap * pSceneMap = NULL);

		void AttachCaptureViewFamilyToCamera(VSCameraActor * pCameraActor,
			unsigned int uiCaptureViewFamilyType,const VSString & ViewFamilyName,
			unsigned int uiWidth,unsigned int uiHeight,
			VSArray<VSString> & SceneMapName,
			VSPostEffectSetRPtr  pPostEffectSet = NULL,bool bDrawDebugInfo = false,bool bBeforePostDebugDraw = true);
		void AttachWindowViewFamilyToCamera(VSCameraActor * pCameraActor,
			unsigned int uiWindowViewFamilyType,const VSString & ViewFamilyName,
			VSArray<VSString> & SceneMapName,
			int iWindowID = -1,
			VSPostEffectSetRPtr  pPostEffectSet = NULL,bool bDrawDebugInfo = false,bool bBeforePostDebugDraw = true);
		VSActor *GetActor(VSUsedName Name);
		void Update(double dAppTime);
		void AddMessage(const VSMessage & Message);

	};
	DECLARE_Ptr(VSWorld);
	VSTYPE_MARCO(VSWorld);
}
#endif